package com.cda.api;

import com.alibaba.fastjson.JSONObject;
import com.cda.entity.SfFacePhotoEntity;
import com.cda.utils.JwtHttpUtil;

public class Test {


    //获取token
    public static String getToken(String userName,String password){
        String url = "http://localhost:9999/jeecg/rest/tokens?username="+userName+"&password="+password;
        String token= JwtHttpUtil.httpRequest(url, "POST", null);
        return token;
    }
    //获取黑名单列表
    public static JSONObject getBlackList(String token){
        String url = "http://localhost:9999/jeecg/rest/sfFacePhotoController/doAdd";
        SfFacePhotoEntity sf = new SfFacePhotoEntity();
        sf.setId("111111111111111");
        sf.setIcNo("11111111111111111123");
        sf.setPhoto("fsdfsdfsdf");
        sf.setIdNo("sdfsdfsdfsdgggg");
        sf.setCreateName("fgghghjhjj");
        String content =  net.sf.json.JSONObject.fromObject(sf).toString();
        System.out.println("发送内容："+content);
        JwtHttpUtil.httpRequest(url, "POST",content,token);
        return null;
    }

    public static void main(String[] args) {
        //接口角色授权的用户账号密码
        System.out.println("--------------------------------");
        String token = getToken("interfaceuser","123456");
        System.out.println("呵呵呵："+token);
        //获取黑名单列表
        System.out.println("======获取黑名单列表======="+getBlackList(token));
    }
}
